#!/bin/bash

export CLASSPATH="./classes"

term_command="terminator"
command_option="-e"

cd classes
rmic fr.univlille1.rmi.SiteImpl -d . -classpath .
cd ..

rmiregistry &
echo "RMI Registry launched"
sleep 5s

$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur1" &
echo "server 1 launched"
sleep 0.2s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur2" &
echo "server 2 launched"
sleep 0.2s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur3" &
echo "server 3 launched"
sleep 0.2s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur4" &
echo "server 4 launched"
sleep 0.2s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur5" &
echo "server 5 launched"
sleep 0.2s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Serveur6" &
echo "server 6 launched"
sleep 5s
$term_command $command_option "java -cp classes fr.univlille1.rmi.Client" &
echo "client launched"
